- type = image.class.to_s == "Image" ? "image" : "attachment"
- image_id = image.class.to_s == "Image" ? image.id : image.image_id
- attachment_id = image.class.to_s == "Image" ? nil : image.id

%li.image{:id => "#{type}_#{image.id}", :'data-image_id' => image_id, :'data-attachment_id' => attachment_id }
  .wrapper
    %span.buffer
    = image_tag image.url(:preview)
  %span.title= truncate(image.title, 30, '...')
  %span.caption= image.caption
  .actions
    %span.delete